﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Test03
{
    class Test03
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请输入一个整数：");
            int num = int.Parse(Console.ReadLine());
            bool isTrue = true;
            for (int i = 2; i < num; i++)
            {
                if (num % i == 0)
                {
                    isTrue = false;
                    break;
                }
            }
            if (isTrue == true)
            {
                Console.WriteLine(num + "是质数");
            }
            else
            {
                Console.WriteLine(num + "不是质数");
            }
            Console.ReadKey();
        }
    }
}
